/*     */ package com.umeng.newxp;
/*     */ 
/*     */ import android.content.Context;
/*     */ import android.text.TextUtils;
/*     */ import com.umeng.common.Log;
/*     */ import com.umeng.newxp.controller.ExchangeDataService;
/*     */ import com.umeng.newxp.controller.XpListenersCenter.NTipsChangedListener;
/*     */ import java.util.ArrayList;
/*     */ import java.util.List;
/*     */ 
/*     */ public class a
/*     */ {
/*  21 */   private static final String c = a.class.getName();
/*  22 */   private List<Promoter> d = null;
/*     */   private Context e;
/*     */   private String f;
/*     */   private String g;
/*  28 */   public a a = a.b;
/*     */   public ExchangeDataService b;
/*  30 */   private int h = -1;
/*     */   private XpListenersCenter.NTipsChangedListener i;
/*  32 */   private boolean j = false;
/*     */ 
/*     */   public a(Context paramContext, ExchangeDataService paramExchangeDataService, XpListenersCenter.NTipsChangedListener paramNTipsChangedListener)
/*     */   {
/*  40 */     this.e = paramContext;
/*  41 */     this.b = paramExchangeDataService;
/*  42 */     this.i = paramNTipsChangedListener;
/*     */   }
/*     */ 
/*     */   public synchronized void a() {
/*  46 */     if (!TextUtils.isEmpty(this.b.sessionId))
/*  47 */       this.b.sessionId = "";
/*  48 */     this.b.requestDataAsyn(this.e, new b(this));
/*     */   }
/*     */ 
/*     */   public synchronized void a(List<Promoter> paramList)
/*     */   {
/*  67 */     if ((paramList == null) || (paramList.size() < 1)) {
/*  68 */       this.a = a.b;
/*  69 */       return;
/*     */     }
/*  71 */     a(paramList, true);
/*  72 */     a(this.b.newTips);
/*  73 */     Log.c(c, this.b.oid + "  : init preload data with promoters...");
/*  74 */     if (this.j)
/*  75 */       for (Promoter localPromoter : this.d)
/*  76 */         Log.c(c, this.b.oid + "  promoter " + localPromoter.title);
/*     */   }
/*     */ 
/*     */   protected void a(int paramInt)
/*     */   {
/*  82 */     Log.c(c, this.b.oid + "  PreloadData set tips " + paramInt);
/*  83 */     int k = this.h;
/*  84 */     this.h = paramInt;
/*  85 */     if ((this.h != k) && (this.i != null))
/*  86 */       this.i.onChanged(this.h);
/*  87 */     if ((this.j) && (this.i != null))
/*  88 */       this.i.onChanged((int)this.b.oid);
/*     */   }
/*     */ 
/*     */   private void a(List<Promoter> paramList, boolean paramBoolean)
/*     */   {
/*  93 */     if (paramBoolean) {
/*  94 */       this.d = new ArrayList();
/*  95 */       this.d.addAll(paramList);
/*     */     } else {
/*  97 */       this.d = paramList;
/*     */     }
/*  99 */     this.f = this.b.sessionId;
/* 100 */     this.g = this.b.opensize;
/*     */ 
/* 102 */     this.a = a.a;
/*     */   }
/*     */ 
/*     */   public List<Promoter> b()
/*     */   {
/* 110 */     Log.c(c, this.b.oid + "  PreloadData use preload data.. ");
/* 111 */     if (this.a == a.a) {
/* 112 */       List localList = this.d;
/* 113 */       this.a = a.b;
/* 114 */       this.d = null;
/* 115 */       if ((this.h != -1) && (this.i != null)) {
/* 116 */         this.h = -1;
/* 117 */         this.i.onChanged(this.h);
/*     */       }
/* 119 */       if ((this.j) && (this.i != null))
/* 120 */         this.i.onChanged(this.h);
/* 121 */       Log.c(c, this.b.oid + "  EXIST preload data  " + localList.size());
/* 122 */       this.b.sessionId = this.f;
/* 123 */       this.b.opensize = this.g;
/* 124 */       return localList;
/*     */     }
/* 126 */     return null;
/*     */   }
/*     */ 
/*     */   public void a(XpListenersCenter.NTipsChangedListener paramNTipsChangedListener) {
/* 130 */     this.i = paramNTipsChangedListener;
/* 131 */     this.a = a.b;
/* 132 */     this.d = null;
/*     */   }
/*     */ 
/*     */   public static enum a
/*     */   {
/*     */   }
/*     */ }

/* Location:           C:\Users\Administrator\Desktop\umeng_sdk.jar
 * Qualified Name:     com.umeng.newxp.a
 * JD-Core Version:    0.6.2
 */